Non-volatile memory or non-volatile storage is computer memory which retains stored information even when it is not powered. Examples of non-volatile memory include read-only memory, flash memory, ferroelectric RAM (F-RAM), and different types of magnetic computer storage devices such as hard disks, floppy disks, and magnetic tape, optical discs. Non-volatile memory is typically used for long-term persistent storage.
Flash memory devices are electronic non-volatile computer storage media that allow accessing or reading stored data, writing new data and erasing stored data. In recent years, due to the overwhelming advantage of large memory size and high rewriting speed, flash memory has played a major role in the non-volatile memory market. Flash memories are used in a variety of applications, for example in USB drives for personal information storage, or embedded in credit cards or gift cards to enable financial payments or transactions. Generally flash memory is used especially for application in which the data is rarely changed but read many times, since they can be read faster than they can be written.
Typically two types of technology are used to manufacture flash memory: NAND and NOR. NAND flash memory is generally characterized by having long rows of bits and they are written a row at a time. To change even a single bit the entire row must be read to a buffer, amended and then written back. In contrast the NOR flash memory technology allows writing the value ‘0’ (zero) to any physical bit address in the storage device, and setting the values to ‘1’ (one) when erasing a sector which includes a plurality of bits (e.g. one or more rows). Generally a flash memory is initialized with the value of ‘1’ (one) in all the bits, so that an application can easily write initial data by changing ‘1’ bits to zeros. Changing zero bits to ones is a slower and more complex process typically requiring backing up the current information of an entire sector to a work memory, correcting the desired bits, erasing the sector in the flash memory by initializing it to ones and changing selected bits to zero based on the modified content of the work memory.
Generally in a flash memory the stored data remains intact between instances of device usage. However, natural degradation, external radiation or magnetic fields may corrupt the values stored in the flash memory. For some applications, such as automotive control applications, financial transactions or medical applications, it is of significant importance to provide storage devices that are reliable, e.g. that indicate whether the stored data is incorrect or corrupted.
Typically adding extra memory bits for every word in the flash memory to implement an error correction code can reduce vulnerability to errors. However this generally requires that for every bit change in a word, the error correction bits need to be rewritten, so that even simple bit changes from one to zero may require using the slower process of erasing and then rewriting an entire sector.
It is desirable to provide a storage device, for example flash-memory based with an error correction scheme that reduces the need to rewrite entire sectors of data for every simple bit change from one to zero, because of the error correction code.